<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        html {
            perspective: 800px;
        }

        body {
            border: 1px red solid;
            background-color: rgb(241, 241, 241);
        }

        .box1 .box2{
            width: 320px;
            height: 320px;
            background-color: #bfa;
            margin-left: 100px;
            margin: 200px auto;
            transition: 2s;
            position: absolute;
        }
div{
    /* float: left; */
    position: relative;
}
        .box1>img {

            /*
                通过旋转可以使元素沿着x y 或 z旋转指定的角度
                    rotateX()
                    rotateY()
                    rotateZ()
            */
            /* transform: rotateZ(.25turn); */
            /* transform: rotateY(180deg) translateZ(400px); */
            /* transform: translateZ(400px) rotateY(180deg) ; */
            /* transform: rotateX(180deg); */
            transform: rotateY(90deg) translateZ(100px);
            /* 是否显示元素的背面 */
            /* backface-visibility: visible; */


        }

        .box2>img {

            /*
    通过旋转可以使元素沿着x y 或 z旋转指定的角度
        rotateX()
        rotateY()
        rotateZ()
*/
            /* transform: rotateZ(.25turn); */
            /* transform: rotateY(180deg) translateZ(400px); */
            /* transform: translateZ(400px) rotateY(180deg) ; */
            /* transform: rotateX(180deg); */
            transform: rotateY(-90deg) translateZ(-100px);
            /* 是否显示元素的背面 */
            /* backface-visibility: visible; */


        }
    </style>
</head>

<body>

    <div class="box1">
        <img src="./img/an.jpg" alt="">
    </div>
    <div class="box2">
        <img src="./img/an.jpg" alt="">
    </div>

</body>

</html>